<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="__PUBLIC__/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <script src="__PUBLIC__/bootstrap-3.3.5-dist/js/jquery-3.1.0.js"></script>
    <script src="__PUBLIC__/bootstrap-3.3.5-dist/js/bootstrap.js" type="text/javascript"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="text/javascript">
        $(document).ready(function () {
            $("div[name='shuangse']").hide();
            $("div[name='leto']").hide();
            $('#caizhong').change(function () {
                if($(this).find('option:selected').text()=='双色球'){
                    $("div[name='shuangse']").show();
                    $("div[name='leto']").hide();
                }
                if($(this).find('option:selected').text()=='大乐透'){
                    $("div[name='leto']").show();
                    $("div[name='shuangse']").hide();
                }
                if($(this).find('option:selected').text()==false){
                    $("div[name='shuangse']").hide();
                    $("div[name='leto']").hide();
                }

            })
            $("input[name='sub1']").click(function () {
                var times=$("input[name='times']").val();
                var red1=$("select[name='red1']").find('option:selected').text();
                var red2=$("select[name='red2']").find('option:selected').text();
                var red3=$("select[name='red3']").find('option:selected').text();
                var red4=$("select[name='red4']").find('option:selected').text();
                var red5=$("select[name='red5']").find('option:selected').text();
                var red6=$("select[name='red6']").find('option:selected').text();
                var blue=$("select[name='blue']").find('option:selected').text();
                var reg= /^[0-9]*$/;
                if(times==false||reg.test(times)==false){

                }else {
                    if (red1 == false && red2 == false && red3 == false && red4 == false && red5 == false && red6 == false && blue == false) {

                    } else {

                        $.ajax({
                            url: "__ROOT__/Admin/Updata/Updata",//互交的地址（控制器）
                            type: "POST",//专递的方法
                            data: {
                                red1: red1,
                                red2: red2,
                                red3: red3,
                                red4: red4,
                                red5: red5,
                                red6: red6,
                                blue: blue,
                            },//互交的数据（post 上传的数据 数据名为user_name 内容是my_data）
                            //dataType: "json",//选择专递文件类型
                            error: function (XMLHttpRequest, textStatus, errorThrown) {//抛出错误信息
                                alert(XMLHttpRequest.status);
                                alert(XMLHttpRequest.readyState);
                                alert(textStatus);
                            },
                            success: function (data, status) {//如果调用php成功
                                if(data==1){
                                    $("strong[name='report']").text('新增数据成功');

                                }
                                if(data==2){
                                    alert('插入数据失败')
                                }
                                if(data==3){
                                    alert('缺少红球或者没有蓝球')
                                }
                                if(data==4){
                                    alert('没有设置期数')
                                }
                                if(data==9){

                                }

                            }

                        })
                    }
                }
            })



        })

    </script>
</head>
<body>
    <div class="row">
        <div class="row">
            <div class="col-xs-12"><h1 style="text-align: center"><em><strong>系统数据跟新</strong></em></h1></div>
        </div>
        <form role="form">
            <div class="row">
                <div class="col-xs-2 col-md-offset-5">
                    <label for="caizhong">彩票种类：</label>
                    <select class="form-control" id="caizhong" name="caizhong">
                        <option></option>
                        <option>双色球</option>
                        <option>大乐透</option>
                    </select>
                </div>

            </div>

                <div class="row">
                    <div class="col-xs-2 col-md-offset-5" >

                        <label >期数：</label>
                        <input type="text" class="form-control" name="times">

                    </div>
            </div>
            <div class="row" style="margin-top: 2%" name="shuangse">
            <div class="col-xs-1 col-md-offset-1">
                <label for="redball">红球：</label>
                <select class="form-control" id="redball" name="red1">
                    <option></option>
                    <volist name="shuang" id="sh">
                        <option>{{$sh}}</option>
                    </volist>

                </select>
            </div>
            <div class="col-xs-1 ">
                <label >红球：</label>
                <select class="form-control" name="red2">

                    <option></option>
                    <volist name="shuang" id="sh">
                        <option>{{$sh}}</option>
                    </volist>

                </select>
            </div>
            <div class="col-xs-1">
                <label >红球：</label>
                <select class="form-control" name="red3">
                    <option></option>
                    <volist name="shuang" id="sh">
                        <option>{{$sh}}</option>
                    </volist>

                </select>
            </div>
            <div class="col-xs-1 ">
                <label >红球：</label>
                <select class="form-control" name="red4">
                    <option></option>
                    <volist name="shuang" id="sh">
                        <option>{{$sh}}</option>
                    </volist>

                </select>
            </div>
            <div class="col-xs-1 ">
                <label >红球：</label>
                <select class="form-control" name="red5">
                    <option></option>
                    <volist name="shuang" id="sh">
                        <option>{{$sh}}</option>
                    </volist>

                </select>
            </div>
            <div class="col-xs-1 ">
                <label >红球：</label>
                <select class="form-control" name="red6">
                    <option></option>
                    <volist name="shuang" id="sh">
                        <option>{{$sh}}</option>
                    </volist>

                </select>
            </div>
            <div class="col-xs-1  col-md-offset-2" >
                <label >蓝球：</label>
                <select class="form-control"  name="blue">
                    <option></option>
                    <volist name="shuanglan" id="shb">
                        <option>{{$shb}}</option>
                    </volist>

                </select>
            </div>

        </div>

            <div class="row" style="margin-top: 2%" name="leto">
                <div class="col-xs-1 col-md-offset-1">
                    <label for="blueball">红球：</label>
                    <select class="form-control" id="blueball" name="lred1">
                        <option></option>
                        <volist name="dale" id="dl">
                            <option>{{$dl}}</option>
                        </volist>

                    </select>
                </div>
                <div class="col-xs-1 ">
                    <label >红球：</label>
                    <select class="form-control" name="lred2">

                        <option></option>
                        <volist name="dale" id="dl">
                            <option>{{$dl}}</option>
                        </volist>

                    </select>
                </div>
                <div class="col-xs-1">
                    <label >红球：</label>
                    <select class="form-control" name="lred3">
                        <option></option>
                        <volist name="dale" id="dl">
                            <option>{{$dl}}</option>
                        </volist>

                    </select>
                </div>
                <div class="col-xs-1 ">
                    <label >红球：</label>
                    <select class="form-control" name="lred4">
                        <option></option>
                        <volist name="dale" id="dl">
                            <option>{{$dl}}</option>
                        </volist>

                    </select>
                </div>
                <div class="col-xs-1 ">
                    <label >红球：</label>
                    <select class="form-control" name="lred5">
                        <option></option>
                        <volist name="dale" id="dl">
                            <option>{{$dl}}</option>
                        </volist>

                    </select>
                </div>
                <div class="col-xs-1  col-md-offset-1" name="lblue1">
                    <label >蓝球：</label>
                    <select class="form-control" >
                        <option></option>
                        <volist name="dale" id="dl">
                            <option>{{$dl}}</option>
                        </volist>

                    </select>
                </div>

                <div class="col-xs-1  " >
                    <label >蓝球：</label>
                    <select class="form-control" name="lblue2">
                        <option></option>
                        <volist name="dalelan" id="dlb">
                            <option>{{$dlb}}</option>
                        </volist>

                    </select>
                </div>

            </div>
            <div class="row" style="margin-top: 5%">
                <div class="col-xs-1 col-md-offset-4 ">
                    <input type="button" class="form-control" value="插入" name="sub1">
                </div>
                <div class="col-xs-1 col-md-offset-1">
                    <input type="button" class="form-control" value="跟新" name="sub2">
                </div>
            </div>

        </form>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <h1 style="text-align: center"><em><strong name="report"></strong></em></h1>
        </div>
    </div>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>